<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //用户输入年份，输出当前年份2月份的天数
        function backDay(){
            var year = prompt('请输入年份');
            var flag = isLeapYear(year);
            if(flag){
                console.log(year +'是闰年，2月份有29天');
            }else{
                console.log(year +'是平年，2月分有28天');
            }
        }
        backDay();
        function isLeapYear(year){
            //如果是闰年我们返回 true 否则 返回false
            var flag = false;
            if (year %4 ==0 && year % 100 !=0 ||year % 400 ==0){
                flag = true;
            }
            return flag;
        }
    </script>
</head>
<body>
    
</body>
</html>